//
//  GetHeight.m
//  Food
//
//  Created by dllo on 15/7/20.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "GetHeight.h"

@implementation GetHeight

+ (CGFloat)hight:(NSString *)text wide:(CGFloat)wide

{
    NSDictionary *dic = @{NSFontAttributeName: [UIFont systemFontOfSize:17]};
    
    //  设置显示多宽的字后换行, 要和你的lebel 宽度相同或小一点.
    
    CGSize size = CGSizeMake(wide, 10000);
    
    CGRect rect = [text boundingRectWithSize:size options:(NSStringDrawingUsesLineFragmentOrigin) attributes:dic context:nil];

    
    return rect.size.height;
    
}


@end
